import click
from app.monitor_metrics.script.alarm_click import AlarmClick


@click.group()
def prom_alarm():
    pass


@prom_alarm.command("export_alarm_record")
@click.option('--start', type=str, help="开始时间： 2022-07-01")
@click.option('--end', type=str, help="开始时间： 2022-07-31")
def export_alarm_record(start, end):
    """
    导出告警记录
    python manage.py export_alarm_record --start 2022-07-01 --end 2022-07-31
    """
    alarm_click = AlarmClick()
    alarm_click.export_alarm_record(start, end)



@prom_alarm.command("export_alarm_rule")
def export_alarm_rule(start, end):
    """
    导出告警规则
    python manage.py export_alarm_rule
    """
    alarm_click = AlarmClick()
    alarm_click.export_alarm_record(start, end)



@prom_alarm.command("export_host_info")
def export_host_info():
    """
    导出主机信息
    python manage.py export_host_info
    """
    alarm_click = AlarmClick()
    alarm_click.export_host_info()